Skip to content

nmc: PD-prep golden fixture — pin dual-target MM-commitment byte layout - #409

Merged
frstrtr merged 1 commit into
masterfrom
nmc/pd-prep-golden-fixture
Jun 24, 2026
Merged

nmc: PD-prep golden fixture — pin dual-target MM-commitment byte layout#409
frstrtr merged 1 commit into
masterfrom
nmc/pd-prep-golden-fixture

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 24, 2026

Copy link
Copy Markdown
Owner

What

Golden-fixture KATs that pin PD acceptance target ahead of the build code. They hand-compute the 44-byte merged-mining marker from the Namecoin/Bitcoin auxpow.cpp reference layout and assert it as an explicit byte literal:

[ fa be 6d 6d ]  4-byte MM magic
[ 32 bytes    ]  chain-merkle root, REVERSED (big-endian display order)
[ 4 bytes LE  ]  tree size = 2^chain_height
[ 4 bytes LE  ]  nonce

#408-independent by construction

Does NOT import or invoke build_mm_commitment (PR #408 PD surface). The literal is an independent oracle PD output must reproduce byte-for-byte — not a mirror of the build side. Zero stack-rot risk; cut off master, not stacked on #408.

Binds to the already-merged verify SSOT:

  • scan_mm_commitment returns MATCH on the live single-slot posture (h=0) and a height-2 multi-slot case, both bare and after scriptSig framing;
  • a wrong-slot presentation is shown to MISMATCH (slot field is load-bearing);
  • aux_expected_index cross-checks the deterministic slot;
  • field offsets [0,4)/[4,36)/[36,40)/[40,44) each checked against independent literals.

Fence / CI

  • src/impl/nmc/ test target only; additive (+3 KATs, suite 77->80 local green).
  • Rides already-allowlisted nmc_auxpow_merkle_test — no build.yml change, no NOT_BUILT trap, no consensus-value change.
  • Qualifies for auto-merge under the fenced-additive rule.

…yout

Pin PD acceptance target ahead of the build code (#408 build_mm_commitment):
hand-compute the 44-byte merged-mining marker from the Namecoin/Bitcoin
auxpow.cpp reference layout (magic | reversed root | LE size | LE nonce) and
assert it as an explicit byte literal. Does NOT import or invoke
build_mm_commitment, so it is an independent oracle rather than a mirror of the
build side. Binds to the already-merged verify SSOT via scan_mm_commitment
(MATCH on the live single-slot posture and a height-2 multi-slot case, plus a
wrong-slot MISMATCH negative) and cross-checks aux_expected_index.

Fenced to the nmc test target (additive, +3 KATs 77->80), rides the
already-allowlisted nmc_auxpow_merkle_test exe; no build.yml or consensus-value
change.
@frstrtr
frstrtr merged commit bc15976 into master Jun 24, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant